tests: Fix issues with menu shells
authorMatthias Clasen <mclasen@redhat.com>
Sat, 1 Jun 2019 03:20:03 +0000 (03:20 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 1 Jun 2019 03:32:10 +0000 (03:32 +0000)
The menu shell is no longer the direct
parent of menu items.

testsuite/gtk/builder.c

index ec8691e0fa9c501f8e8c0de5ebe772d160b1ca11..0b9d928b478f154834c64efe60f4e997364bf16c 100644 (file)
@@ -2000,7 +2000,7 @@ get_parent_menubar (GtkWidget *menuitem)
   GtkMenuShell *menu_shell;
   GtkWidget *attach = NULL;
 
-  menu_shell = GTK_MENU_SHELL (gtk_widget_get_parent (menuitem));
+  menu_shell = GTK_MENU_SHELL (gtk_widget_get_ancestor (menuitem, GTK_TYPE_MENU_SHELL));
 
   g_assert (GTK_IS_MENU_SHELL (menu_shell));
 
@@ -2008,7 +2008,7 @@ get_parent_menubar (GtkWidget *menuitem)
     {
       if (GTK_IS_MENU (menu_shell) && 
          (attach = gtk_menu_get_attach_widget (GTK_MENU (menu_shell))) != NULL)
-       menu_shell = GTK_MENU_SHELL (gtk_widget_get_parent (attach));
+       menu_shell = GTK_MENU_SHELL (gtk_widget_get_ancestor (attach, GTK_TYPE_MENU_SHELL));
       else
        menu_shell = NULL;
     }